#include "StdAfx.h"
#include "ListFooterUI.h"
#include "LabelPanelUI.h"
#include "PaddingPanelUI.h"
#include "BlueRenderEngineUI.h"

CListFooterUI::CListFooterUI(void)
{
	CLabelPanelUI* pLabel = new CLabelPanelUI;
	Add(pLabel);
	CPaddingPanelUI* pPadding = new CPaddingPanelUI;
	Add(pPadding);
}

CListFooterUI::~CListFooterUI(void)
{
}

LPCTSTR CListFooterUI::GetClass() const
{
	return _T("ListFooterUI");
}

LPVOID CListFooterUI::GetInterface(LPCTSTR pstrName)
{
	if( _tcscmp(pstrName, _T("ListFooter")) == 0 ) return this;
	return CHorizontalLayoutUI::GetInterface(pstrName);
}

SIZE CListFooterUI::EstimateSize(SIZE /*szAvailable*/)
{
	return CStdSize(0, 8 + m_pManager->GetThemeFontInfo(UIFONT_NORMAL).tmHeight);
}

void CListFooterUI::DoPaint(HDC hDC, const RECT& rcPaint)
{
	COLORREF clrBack1, clrBack2;
	m_pManager->GetThemeColorPair(UICOLOR_HEADER_BACKGROUND, clrBack1, clrBack2);
	CBlueRenderEngineUI::DoPaintFrame(hDC, m_pManager, m_rcItem, UICOLOR_HEADER_BORDER, UICOLOR_HEADER_BORDER, UICOLOR_HEADER_BACKGROUND, 0);
	RECT rcTop = { m_rcItem.left + 1, m_rcItem.top, m_rcItem.right - 1, m_rcItem.top + 1 };
	CBlueRenderEngineUI::DoPaintGradient(hDC, m_pManager, rcTop, clrBack2, clrBack1, true, 2);
	RECT rcBottom = { m_rcItem.left + 1, m_rcItem.bottom - 3, m_rcItem.right - 1, m_rcItem.bottom };
	CBlueRenderEngineUI::DoPaintGradient(hDC, m_pManager, rcBottom, clrBack1, clrBack2, true, 4);
	// Paint items as well...
	CHorizontalLayoutUI::DoPaint(hDC, rcPaint);
}
